package org.apache.jsp.manager.sales;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;

public final class productFind_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=euc-kr");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      java.util.Hashtable outputTable = null;
      synchronized (request) {
        outputTable = (java.util.Hashtable) _jspx_page_context.getAttribute("outputTable", PageContext.REQUEST_SCOPE);
        if (outputTable == null){
          outputTable = new java.util.Hashtable();
          _jspx_page_context.setAttribute("outputTable", outputTable, PageContext.REQUEST_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      java.util.Hashtable inputTable = null;
      synchronized (request) {
        inputTable = (java.util.Hashtable) _jspx_page_context.getAttribute("inputTable", PageContext.REQUEST_SCOPE);
        if (inputTable == null){
          inputTable = new java.util.Hashtable();
          _jspx_page_context.setAttribute("inputTable", inputTable, PageContext.REQUEST_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("\r\n");

	ArrayList goodsList= (ArrayList)outputTable.get("goodsList");

      out.write("\r\n");
      out.write("<SCRIPT language=\"JavaScript\">\r\n");
      out.write("\t// 선택\r\n");
      out.write("\tfunction selectAction(seq)\r\n");
      out.write("\t{\r\n");
      out.write("\t\topener.salesForm.productName.value=seq;\r\n");
      out.write("\t\twindow.self.close();\r\n");
      out.write("\t}\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<TABLE cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t<FORM name=\"findForm\" action=\"servlet/service.ManagerSalesServlet?func=msales_004\" method=\"post\">\r\n");
      out.write("\t\t<INPUT type=\"hidden\" name=\"seq\" value=\"\">\r\n");
      out.write("\t\t<TR align=\"center\"><TD height=\"35\"><FONT face=\"돋움체\" size=\"3\" color=\"#666666\"><B>상품찾기 결과</B></FONT></TD></TR>\r\n");
      out.write("\t<FORM>\r\n");
      out.write("</TABLE>\r\n");
      out.write("<TABLE valign=\"top\" style=\"border-collapse:collapse;\" cellpadding=\"3\" cellspacing=\"0\" width=\"450\" border=\"1\" bordercolor=\"#BABABA\" frame=\"hsides\">\r\n");
      out.write("\t<TR align=\"center\" bgcolor=\"F9F9F9\">\r\n");
      out.write("\t\t<TD width=\"40\"><FONT face=\"돋움체\" size=\"2\" color=\"#666666\"><B>번호</B></FONT></TD>\r\n");
      out.write("\t\t<TD width=\"150\"><FONT face=\"돋움체\" size=\"2\" color=\"#666666\"><B>상품이미지</B></FONT></TD>\r\n");
      out.write("\t\t<TD><FONT face=\"돋움체\" size=\"2\" color=\"#666666\"><B>상품 이름</FONT></B></TD>\r\n");
      out.write("\t</TR>\r\n");

	if(goodsList.size()==0)
	{

      out.write("\r\n");
      out.write("\t<TR>\r\n");
      out.write("\t\t<TD colspan=\"3\" align=\"center\">\r\n");
      out.write("\t\t\t<FONT face=\"돋움체\" size=\"2\" color=\"#666666\">물품이 존재하지 않습니다.</FONT>\r\n");
      out.write("\t\t</TD>\r\n");
      out.write("\t</TR>\r\n");

	}
	else
	{
		for (int i=0; i<goodsList.size(); i++)
		{
			Hashtable goodsTable = (Hashtable)goodsList.get(i);
			String path = (String)goodsTable.get("PATH");
			String seq = (String)goodsTable.get("SEQ");
			String name = (String)goodsTable.get("NAME");

      out.write("\r\n");
      out.write("\t\t<TR  align=\"center\">\r\n");
      out.write("\t\t\t<TD width=\"40\"><FONT face=\"돋움체\" size=\"2\" color=\"#666666\">");
      out.print(i+1);
      out.write("</FONT></TD>\r\n");
      out.write("\t\t\t<TD width=\"150\">\r\n");
      out.write("\t\t\t\t<FONT face=\"돋움체\" size=\"2\" color=\"#666666\">\r\n");
      out.write("\t\t\t\t\t");
if (path==null || path.length()==0){
      out.write("이미지없음");
} else{
      out.write("<IMG src='");
      out.print(path);
      out.write("' width=\"100\" height=\"50\">");
}
      out.write("\r\n");
      out.write("\t\t\t\t</FONT>\r\n");
      out.write("\t\t\t</TD>\r\n");
      out.write("\t\t\t<TD><A href=\"javascript:selectAction('");
      out.print(seq);
      out.write("')\"><FONT face=\"돋움체\" size=\"2\" color=\"#666666\">");
      out.print(name);
      out.write("</FONT></A></TD>\r\n");
      out.write("\t\t</TR>\r\n");

		}
	}

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
